import {
  mapGetters
} from 'vuex';
export default {

  computed: {
    ...mapGetters('m_cart', ['total']), // 确保命名空间和状态正确
  },
  watch: {
    total() {
      this.setBadge()
    }
  },
  onShow() {
    this.setBadge()
  },
  methods: {
    setBadge() {
      uni.setTabBarBadge({
        index: 2,
        text: this.total + ''
      })
    },
  }
}